<template>
  <div>
    <!-- 数字的变化  -->
    <input type="number" step="100" v-model="counter" />
    <!-- 当前计数：{{ showCounter }} -->
    当前计数：{{ showNumber.toFixed(0) }}
  </div>
</template>

<script>
import gsap from "gsap";
export default {
  name: "App",
  components: {},
  data() {
    return {
      counter: 0,
      showNumber: 0,
    };
  },
  // computed: {
  //   showCounter() {
  //     return this.showNumber.toFixed(0);
  //   },
  // },
  watch: {
    counter(newVal) {
      gsap.to(this, { duration: 1, showNumber: newVal });
    },
  },
};
</script>

<style></style>
